
<!DOCTYPE html>
<html lang="zh-cn">

<head><meta name="generator" content="Hexo 3.8.0">
    <title>
        自定义样式 - Admui 开发文档</title>
    <meta charset="utf-8">
    <meta name="keywords" content="admui,admui官网,admui框架,通用后台管理系统,后台框架,ui框架">
    <meta name="description" content="Admui 是一个基于最新 Web 技术的企业级通用管理系统快速开发框架，可以帮助企业极大的提高工作效率，节省开发成本，提升品牌形象">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
    <!--[if lte IE 9]>
    <meta http-equiv="refresh" content="0; url='http://www.admui.com/ie'" />
    <![endif]-->
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-title" content="Admui">
    <meta name="msapplication-TileImage" content="http://cdn.admui.com/site/img/app/icon-72@x2.png">
    <meta name="msapplication-TileColor" content="#395b81">
    <link rel="apple-touch-icon-precomposed" href="http://cdn.admui.com/site/img/app/icon-72@x2.png">
    <link rel="shortcut icon" href="http://cdn.admui.com/site/img/app/favicon.png">
    <meta name="msapplication-TileColor" content="#62a8ea">
    <script>
        window.PAGE_TYPE = "ui"
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "https://hm.baidu.com/hm.js?cd758c4c82a4964836712308cb782b12";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
    </script>
    <link rel="stylesheet" href="http://cdn.admui.com/docs/v1/css/page.css">
</head>

<body>
    <div id="mobile-bar">
        <a class="menu-button"></a>
        <a class="logo" href="../../index.html">Admui开发文档</a>
        <select class="version-select">
            <option value="basic">基础版</option>
            <option value="pjax">pjax版</option>
            <option value="iframe" selected>iframe版</option>
        </select>
    </div>
    <div id="header">
    <a id="logo" href="../../index.html">
        <img src="http://cdn.admui.com/docs/common/images/logo.svg"> <span>Admui 开发文档</span>
    </a>
    <select class="version-select">
        <option value="basic/1.x">基础版</option>
        <option value="pjax/1.x">pjax版</option>
        <option value="iframe/1.x" selected>iframe版</option>
    </select>
    <ul id="nav">
        <li>
    <a href="../index.html" class="nav-link">首页</a>
</li>
<li>
    <a href="../guide/index.html" class="nav-link">介绍</a>
</li>
<li>
    <a href="index.html" class="nav-link current">UI</a>
</li>
<li>
    <a href="../java/index.html" class="nav-link">JAVA</a>
</li>
<li>
    <a href="../logs/index.html" class="nav-link">更新日志</a>
</li>
<li>
    <a href="../../index.html" class="nav-link">v2版本</a>
</li>

    </ul>
</div>
    
    <div id="main" class="fix-sidebar">
        
        
<div class="sidebar">
    <ul class="main-menu">
        <li>
    <a href="../index.html" class="nav-link">首页</a>
</li>
<li>
    <a href="../guide/index.html" class="nav-link">介绍</a>
</li>
<li>
    <a href="index.html" class="nav-link current">UI</a>
</li>
<li>
    <a href="../java/index.html" class="nav-link">JAVA</a>
</li>
<li>
    <a href="../logs/index.html" class="nav-link">更新日志</a>
</li>
<li>
    <a href="../../index.html" class="nav-link">v2版本</a>
</li>

    </ul>
    <div class="list">
        <ul class="menu-root">
            
            <li>
                <a href="index.html" class="sidebar-link ">基本概述</a>
            </li>
            
            <li>
                <a href="themes.html" class="sidebar-link ">主题说明</a>
            </li>
            
            <li>
                <a href="build.html" class="sidebar-link ">构建工具</a>
            </li>
            
            <li>
                <a href="files.html" class="sidebar-link ">页面引用资源</a>
            </li>
            
            <li>
                <a href="structure.html" class="sidebar-link ">模板结构</a>
            </li>
            
            <li>
                <a href="hello-world.html" class="sidebar-link ">Hello world</a>
            </li>
            
            <li>
                <a href="style.html" class="sidebar-link current ">自定义样式</a>
            </li>
            
            <li>
                <a href="javascript.html" class="sidebar-link ">JS 模块</a>
            </li>
            
            <li>
                <a href="description.html" class="sidebar-link ">特别说明</a>
            </li>
            
            <li>
                <a href="components.html" class="sidebar-link ">UI 组件</a>
            </li>
            
            <li>
                <a href="plugins.html" class="sidebar-link ">第三方插件</a>
            </li>
            
            <li>
                <a href="icons.html" class="sidebar-link ">字体图标</a>
            </li>
            
            <li>
                <a href="code-guide.html" class="sidebar-link ">编码规范</a>
            </li>
            
        </ul>
    </div>
</div>


<div class="content ui with-sidebar">
    <h1>自定义样式</h1>
    <h2 id="使用-CSS-定义"><a href="#%E4%BD%BF%E7%94%A8-CSS-%E5%AE%9A%E4%B9%89" class="headerlink" title="使用 CSS 定义"></a>使用 CSS 定义</h2><p>页面的样式文件位于<code>/public/css</code>文件夹，第三方插件样式文件位于<code>/public/vendor/(插件名)</code>文件夹下，主题相关的样式文件位于<code>/public/themes/(主题名)/(布局名)/css</code>下，主题相关的皮肤样式文件位于<code>/public/themes/(主题名)/(布局名)/skins</code>下。</p>
<blockquote>
<p>Notes：使用 CSS 定义时，您还必须禁用所有的 Gulp 的 Less 编译任务。</p>
</blockquote>
<h2 id="使用-LESS-定义"><a href="#%E4%BD%BF%E7%94%A8-LESS-%E5%AE%9A%E4%B9%89" class="headerlink" title="使用 LESS 定义"></a>使用 LESS 定义</h2><p>Bootstrap v3 使用 Less 来作为 CSS 的预处理器。</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">/src/themes/(主题名)/(布局名)/less/</span><br><span class="line">    ├── layouts/</span><br><span class="line">    ├── sections/</span><br><span class="line">    ├── vars-customs.less</span><br><span class="line">    ├── vars-site.less</span><br><span class="line">    └── vars.less</span><br><span class="line"></span><br><span class="line">/src/themes/(主题名)/global/less/</span><br><span class="line">    ├── bootstrap/</span><br><span class="line">    ├── bootstrap_extend/</span><br><span class="line">    ├── components/</span><br><span class="line">    ├── vars-bootstrap.less</span><br><span class="line">    ├── vars-components.less</span><br><span class="line">    └── vars.less</span><br></pre></td></tr></table></figure>
<p>当编译布局Less文件时，会使用<code>/src/</code>下的 Less 文件，如果需要修改 Less 文件编译后输出的位置，可通过配置<code>/src/gulp/configuration/config.json</code>实现。</p>
<p>如果您所购买的产中不包含 Gulp 自动构建的部分，您可以通过在线升级的方式购买自动构建部分。<a href="http://www.admui.com/buy" target="_blank" rel="noopener">升级</a></p>
<blockquote>
<p>Notes：如果您是一个 Less 的新手，请访问 <a href="http://lesscss.org/" target="_blank" rel="noopener">Less官网</a> 或 <a href="http://www.lesscss.cn/" target="_blank" rel="noopener">Less中文网</a></p>
</blockquote>
<h2 id="轻松定制"><a href="#%E8%BD%BB%E6%9D%BE%E5%AE%9A%E5%88%B6" class="headerlink" title="轻松定制"></a>轻松定制</h2><p>此章节只针对于使用 Less 的用户。</p>
<p>为了使 CSS 更便于维护，更主题化和便于扩展，我们已经增加了许多功能，并使用了 variables(变量), mixins(混合), functions(函数)等方式。它们位于<code>/src/themes/(主题名)/global/less/bootstrap-extend/mixins</code>文件夹下，您可以通过您喜欢的方式进行编码。</p>
<p>核心变量定义在以下几个文件中：</p>
<figure class="highlight plain"><table><tr><td class="code"><pre><span class="line">/src/themes/(主题名)/global/src/less/vars_bootstrap.less</span><br><span class="line">/src/themes/(主题名)/global/src/less/vars_color.less</span><br><span class="line">/src/themes/(主题名)/(布局名)/less/vars_site.less</span><br></pre></td></tr></table></figure>
<p>更多的变量在Less文件头部定义，如：</p>
<figure class="highlight less"><table><tr><td class="code"><pre><span class="line"><span class="variable">@alert-padding-horizontal:</span>        <span class="number">20px</span>;</span><br><span class="line"><span class="variable">@alert-list-padding-left:</span>         <span class="number">13px</span>;</span><br><span class="line"><span class="variable">@alert-list-item-padding-left:</span>    <span class="number">7px</span>;</span><br></pre></td></tr></table></figure>
    
    <div class="page-links">
        
        <span><a href="hello-world.html">&lang; 上一页：Hello world</a></span>
        
        
        <span style="float:right"><a href="javascript.html">下一页：JS 模块 &rang;</a></span>
        
    </div>
    
    <div class="footer">
    &copy; 2015-2017
    <a href="http://www.admui.com/">Admui</a>
    ·
    上海畅控
</div>
</div>

        
    </div>
    

    <script src="https://cdn.staticfile.org/smooth-scroll/14.2.1/smooth-scroll.min.js"></script>
    <script src="http://cdn.admui.com/docs/common/js/common.js"></script>

    <script src="https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            FastClick.attach(document.body);
        }, false);
        (function () {
            var bp = document.createElement('script');
            var curProtocol = window.location.protocol.split(':')[0];
            if (curProtocol === 'https') {
                bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
            }
            else {
                bp.src = 'http://push.zhanzhang.baidu.com/push.js';
            }
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(bp, s);
        })();
    </script>

</body>

</html>